cmake_minimum_required(VERSION 3.12)

# 必须写，不然后面无法生成可执行文件
project(FOTF100_SRC VERSION 1.0.0 LANGUAGES CXX)

list(APPEND CMAKE_MESSAGE_INDENT "[ SRC ] ==> ")

set(CMAKE_CXX_STANDARD 11)

SET(CMAKE_CXX_STANDARD_REQUIRED ON)

# 指示CMAKE在查找头文件时包括当前目录
SET(CMAKE_INCLUDE_CURRENT_DIR ON)

################################## 配置QT5环境 #################################
load_qt(5)

# 搜索头文件的目录路径
include_directories(
	${PROJECT_SOURCE_DIR}
	${PROJECT_SOURCE_DIR}/camera
	${PROJECT_SOURCE_DIR}/common
	${PROJECT_SOURCE_DIR}/datasource
	${PROJECT_SOURCE_DIR}/logger
	${PROJECT_SOURCE_DIR}/serials
	${PROJECT_SOURCE_DIR}/threads
	${PROJECT_SOURCE_DIR}/utils
	${PROJECT_SOURCE_DIR}/database
)

file(GLOB_RECURSE PROJECT_CPP_SOURCES
	${PROJECT_SOURCE_DIR}/camera/*.cpp
	${PROJECT_SOURCE_DIR}/common/*.cpp
	${PROJECT_SOURCE_DIR}/datasource/*.cpp
	${PROJECT_SOURCE_DIR}/logger/*.cpp
	${PROJECT_SOURCE_DIR}/serials/*.cpp
	${PROJECT_SOURCE_DIR}/threads/*.cpp
	${PROJECT_SOURCE_DIR}/utils/*.cpp
	${PROJECT_SOURCE_DIR}/database/*.cpp
)

SET(PROJECT_CPP_SOURCES ${PROJECT_CPP_SOURCES})

# 配置软件版本
if(EXISTS ${PROJECT_SOURCE_DIR}/projectConfig.h.in)
	# 获取项目版本，项目版本=GIT分支版本
	get_project_version(MY_PROJECT_VERSION)
	configure_file(
		${PROJECT_SOURCE_DIR}/projectConfig.h.in
		${PROJECT_SOURCE_DIR}/projectConfig.h
	)
endif()

add_definitions("-DUNICODE" "-D_UNICODE")


# 添加对话框子项目
add_subdirectory(app)





